﻿@model GameSchool.Models.ViewModels.CourseView
@{
    ViewBag.Title = "Course";
}

<h2>@Model.m_theCourse.Name</h2>
<!--
<div class="span7">
    <div class="tabbable">
      <ul class="nav nav-tabs">
        <li class="active"><a href="@Url.Action("GetCourse", "Student", new { id = Model.m_theCourse.ID })">@Model.m_theCourse.Name</a></li>
        <li><a href="@Url.Action("GetLecturesForLevel", "Student", new { id = Model.m_theCourse.ID })" data-toggle="tab">Fyrirlestrar</a></li>
        <li><a href="#" data-toggle="tab">Glósur</a></li>
        <li><a href="#" data-toggle="tab">Tilkynningar frá kennara</a></li>
      </ul>
   </div>

</div>
-->

<div class="span7">
    <div class="tabbable">
      <ul class="nav nav-tabs">
        <li class="active"><a href="#tab1" data-toggle="tab">@Model.m_theCourse.Name</a></li>
        <li><a href="#tab2" data-toggle="tab">Fyrirlestrar</a></li>
        <li><a href="#tab3" data-toggle="tab">Stig</a></li>
        <li><a href="#tab4" data-toggle="tab">Tilkynningar frá kennara</a></li>
        <li><a href="#tab5" data-toggle="tab">Próf</a></li>
        <li><a href="#tab6" data-toggle="tab">Verkefni</a></li>
      </ul>
   </div>
   <div class="tab-content">
    <div class="tab-pane active" id="tab1">
        <legend><h3 class="StudentHeadings">Áfangalýsing</h3></legend>
        <div id="CourseText">
            <p>@Model.m_theCourse.Description</p>
        </div>
        <div id="CourseStuff">
            <legend><h3 class="StudentHeadings">Áfangastraumur</h3></legend>
            @Html.Action("NewsFeed", "Student", new { LevelID = Model.m_CurrentLevel, CourseID = Model.m_theCourse.ID })
        </div>
    </div>
    <div class="tab-pane" id="tab2">
        @Html.Action("GetLecturesForLevel", "Student", new { id = Model.m_CurrentLevel })
    </div>
    <div class="tab-pane" id="tab3">
        <div id="XPTab">
           @Html.Action("XPCourseList", "Student", new { id = Model.m_theCourse.ID })
        </div>
    </div>
    <div class="tab-pane" id="tab4">
        <legend><h3 class="StudentHeadings">Tilkynningar</h3></legend>
    </div>
    <div class="tab-pane" id="tab5">
        <legend><h3 class="StudentHeadings">Próf</h3></legend>
        @Html.Action("GetTestsForLevel", "Student", new { id = Model.m_CurrentLevel })
    </div>
    <div class="tab-pane" id="tab6">
        <legend><h3 class="StudentHeadings">Verkefni</h3></legend>
        @Html.Action("GetAssignmentsForLevel", "Student", new { id = Model.m_CurrentLevel })
    </div>
  </div>

</div>


<div class="offset7 span3">
    <ul class="nav nav-pills nav-stacked">
        @{
            string finished;
            foreach (var lvl in Model.m_theLevels)
            {
                if (lvl.ID == Model.m_CurrentLevel)
                {
                    finished = "alert-info";
                }
                else if (lvl.ID > Model.m_CurrentLevel)
                {
                    finished = "alert-error";
                }
                else
                {
                    finished = "alert-success";
                }
        
                <li class="alert @finished">@Html.ActionLink("Borð " + lvl.NumberInCourse + ": " + lvl.Name,
                                                                    "/GetLevel/" + lvl.ID, "Student")
                
                <p class="nav-header">Fyrirlestrar</p>
                @foreach (var lecture in Model.m_theLectures)
                {
                    if (lecture.LevelID == lvl.ID)
                    {
                        <p class="navig">@lecture.Name [@lecture.Points XP]
                        @if (Model.m_FinishedLecturesID.Contains(lecture.ID))
                        {
                            <i class="icon-ok"></i>
                        }
                        else
                        {
                            <i class="icon-fire"></i>
                        }
                        </p>
                    }
                }

                <p class="nav-header">Verkefni</p>
                @foreach (var assignment in Model.m_theAssignments)
                {
                    if (assignment.LevelID == lvl.ID)
                    {
                        <p class="navig">@assignment.Name [@assignment.Points XP]
                        @if (Model.m_FinishedAssignments.Contains(assignment.ID))
                        {
                            <i class="icon-ok"></i>
                        }
                        else
                        {
                            <i class="icon-fire"></i>
                        }
                        </p>
                    }
                }

                <p class="nav-header">Próf</p>
                @foreach (var test in Model.m_theTests)
                {
                    if (test.LevelID == lvl.ID)
                    {
                        <p class="navig">@test.Name [@test.Points XP]
                        @if (Model.m_FinishedTestsID.Contains(test.ID))
                        {
                            <i class="icon-ok"></i>
                        }
                        else
                        {
                            <i class="icon-fire"></i>
                        }
                        </p>   
                    }
                }
                </li>
            }
                
            
        }
    </ul>
</div>
